<!doctype html>
<html lang="en">
<head>
    <title>ComboBox - Dropdown Position</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="%description%" />
    <meta name="keywords" content="" />
    <meta name="author" content="ComponentOne" />
    
    <link href="../../themes/rocket/jquery-wijmo.css" rel="stylesheet" type="text/css" />
    
    <script src="../../external/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="../../external/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>
    <link href="../../themes/wijmo/jquery.wijmo-open.2.3.2.css" rel="stylesheet" type="text/css" />
    <link href="../../themes/wijmo/jquery.wijmo.wijcombobox.css" rel="stylesheet" type="text/css" />
    <script src="../../external/jquery.mousewheel.min.js" type="text/javascript"></script>
    <script src="../../external/jquery.wijmo-open.all.2.3.2.min.js" type="text/javascript"></script>
    <script src="../../wijmo/jquery.wijmo.wijdatasource.js" type="text/javascript"></script>
    <script src="../../wijmo/jquery.wijmo.wijcombobox.js" type="text/javascript"></script>
    <script id="scriptInit" type="text/javascript">
        $(document).ready(function () {
            var testArray = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
            var myReader = new wijarrayreader([{ name: 'label' }, { name: 'value' }, { name: 'selected', defaultValue: false}]);
            var datasourceOptions = {
                reader: myReader,
                data: testArray
            };
            var datasource = new wijdatasource({
                reader: myReader,
                data: testArray
            });

            $("#tags").wijcombobox({
                data: datasource,
                width: 150
            });
            $('.position').bind('change', changed);
        });

        function changed() {
            $("#tags").wijcombobox('option', 'dropDownListPosition', {
                my: $('#my_horizontal').val() + ' ' + $('#my_vertical').val(),
                at: $('#at_horizontal').val() + ' ' + $('#at_vertical').val(),
                offset: $('#offset').val(),
                collision: $("#collision_horizontal").val() + ' ' + $("#collision_vertical").val()
            });
        }
    </script>
</head>
<body class="demo-single">
    <div class="container">
        <div class="header">
            <h2>
                Dropdown Position</h2>
        </div>
        <div class="main demo">
            <!-- Begin demo markup -->
            <div>
                <input id="tags" />
            </div>
            <!-- End demo markup -->
            <div class="demo-options">
                <!-- Begin options markup -->
                <div class="option-row">
                    <label for="my_horizontal">
                        Dropdown list:</label>
                    <select id="my_horizontal" class="position">
                        <option value="left">left</option>
                        <option value="center">center</option>
                        <option value="right">right</option>
                    </select>
                    <select id="my_vertical" class="position">
                        <option value="top">top</option>
                        <option value="middle">center</option>
                        <option value="bottom">bottom</option>
                    </select>
                </div>
                <div class="option-row">
                    <label for="at_horizontal">
                        Aligns to textbox:</label>
                    <select id="at_horizontal" class="position">
                        <option value="left">left</option>
                        <option value="center">center</option>
                        <option value="right">right</option>
                    </select>
                    <select id="at_vertical" class="position">
                        <option value="top">top</option>
                        <option value="middle">center</option>
                        <option value="bottom">bottom</option>
                    </select>
                </div>
                <div class="option-row">
                    <label for="offset">
                        With offset:</label>
                    <input onblur="changed()" id="offset" type="text" size="15" />
                </div>
                <div class="option-row">
                    <label for="collision_horizontal">
                        Horizontal collision detection:</label>
                    <select id="collision_horizontal">
                        <option value="flip">flip</option>
                        <option value="fit">fit</option>
                        <option value="none">none</option>
                    </select>
                    <label for="collision_vertical">
                        Vertical collision detection:</label>
                    <select id="collision_vertical">
                        <option value="flip">flip</option>
                        <option value="fit">fit</option>
                        <option value="none">none</option>
                    </select>
                </div>
                <!-- End options markup -->
            </div>
        </div>
        <div class="footer demo-description">
            <p>
This sample shows how you can change the position of the drop-down list for the wijcombobox by setting the <b>dropDownListPosition</b> option.
            </p>
        </div>
    </div>
</body>
</html>
